package com.hbsd.paopaobackend;

import com.hbsd.paopaobackend.netty.CoordinationNettyServer;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@MapperScan("com.hbsd.paopaobackend.mapper")
// 开启定时任务
@EnableScheduling
public class PaoPaoApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(PaoPaoApplication.class, args);
    }

    // 注入 Netty服务
    @Autowired
    private CoordinationNettyServer nettyServer;
    @Override
    public void run(String... args) throws Exception {
        nettyServer.start();
    }
}
